﻿@model PagedList<ADZ_JingjiaSubmit>
@{
    ViewBag.Title = "竞价出价列表";
    Layout = "~/Views/Shared/_ContentLayout.cshtml";

    JingjiaQueryModel paramModel = new JingjiaQueryModel();
    if (ViewBag.paramModel != null)
    {
        paramModel = (JingjiaQueryModel)ViewBag.paramModel;
    }
    ADZ_MasterEntities dbcontext = new ADZ_MasterEntities();
}
@if (Model != null && Model.Count != 0)
{
    var jingjia_master = dbcontext.ADZ_JingjiaMaster.FirstOrDefault(t => t.jingjia_id == paramModel.jingjia_id);
    if (jingjia_master == null)
    {
        return;
    }

    <div class="back_button_div">
        竞价包【@jingjia_master.jingjia_name】的出价记录如下： <button type="button" class="btn btn-success" name="backid" id="backid">返回</button>
    </div>
    <table class="table table-bordered table-hover definewidth m10">
        <thead>
            <tr>
                <th>竞价名称</th>
                <th>用户昵称</th>
                <th>用户手机</th>
                <th>用户UID</th>
                <th>出价时间</th>
                <th>出价金额</th>
                <th>是否成交</th>
                <th>竞价状态</th>
            </tr>
        </thead>

        @if (Model != null && Model.Count != 0)
        {
            int index = 0;
            foreach (var m in Model)
            {
                index++;
                var userinfo = dbcontext.ADZ_MemberMaster.FirstOrDefault(t => t.uid == m.uid);
                if (userinfo == null)
                {
                    continue;
                }



                <tr class="@HtmlPagerHelper.TrClass(index)">
                    <td>@jingjia_master.jingjia_name</td>
                    <td>
                        <a href="/account/defailinfo?uid=@userinfo.uid">@userinfo.member_name</a>
                    </td>
                    <td>
                        @userinfo.account_mobile
                    </td>
                    <td>
                        @userinfo.uid
                    </td>
                    <td>
                        @m.create_time.ToString(1)
                    </td>
                    <td>@m.my_price.ToString("N2")</td>
                    <td>
                        @if (m.is_hit == 0)
                        {
                            <info>未成交</info>
                        }
                        @if (m.is_hit == 1)
                        {
                            <info class="green">已成交</info>
                        }
                    </td>
                    <td>
                        @if (m.status == 0)
                        {
                            <info>已报价</info>
                        }
                        @if (m.status == 1)
                        {
                            <info class="red">被超越</info>
                        }
                        @if (m.status == 2)
                        {
                            <info class="green">已成交</info>
                        }
                        @if (m.status == 10)
                        {
                            <info class="green">已付款</info>
                        }
                    </td>
                </tr>
            }
        }
    </table>
    <div class="inline pull-left total">
        总行数：@ViewData["AllCount"]
    </div>
    <div class="inline pull-right page">
        @if (Model != null)
        {
            @Html.Pager(Model, HtmlPagerHelper.BasePagerOption)
        }
    </div>
}